package com.xhhospital.servlet;

import com.xhhospital.dao.BrxxDao;
import com.xhhospital.entity.Brxx;

import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.util.ArrayList;
import java.util.List;

@WebServlet(name = "showedit1",urlPatterns = "/showedit1")
public class showedit1 extends HttpServlet {
    protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
        request.setCharacterEncoding("utf-8");
        response.setCharacterEncoding("utf-8");
        List<Brxx> list=new ArrayList<Brxx>();
        list= BrxxDao.showAllBrxx();//根据传递编号，返回实体对象
        if (list!=null){
            //请求转发
            request.setAttribute("showbrxx",list);
            request.getRequestDispatcher("/xiugai2.jsp").forward(request,response);
        }
    }

    protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {

    }
}
